﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="Scripts/jquery-2.0.1.min.js"></script>
    <script src="Scripts/jquery.btechco.excelexport.js"></script>
    <script src="Scripts/jquery.base64.js"></script>
</head>
<body>
    <div id="dvxml">
    </div>
    <div>
        <button id="btnExport">Export</button>
    </div>
</body>
</html>
<script>
    $(document).ready(function () {
        $("#btnExport").click(function () {
            var dataobj;

            $.ajax({
                type: "GET"
                , async: false
                , url: "jqgrid.xml"
                , dataType: "xml"
                , success: function (data) {
                    dataobj = data;
                }
                , error: function (xhr, ajaxOptions, thrownError) {
                }
            });

            $("#dvxml").btechco_excelexport({
                containerid: "dvxml"
                , datatype: $datatype.JqGrid
                , dataset: dataobj
                , columns: [
                    { headertext: "CDL Id", datafield: "cdlId", ishidden: false, width: "50px" }
                    , { headertext: "CDL No", datafield: "cdlNo", ishidden: false, width: "50px" }
                    , { headertext: "Defect No", datafield: "defectNo", ishidden: true, width: "50px" }
                    , { headertext: "Defect Desc", datafield: "defectDesc", ishidden: false, width: "50px" }
                ]
            });
        });
    });
</script>
